package File;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

/*
 * 分别使用字符流和字节流复制图片
 */
public class Copymage {
	public static void main(String[] args) throws IOException {
		FileInputStream fis = new FileInputStream("1.png");
		FileOutputStream fos = new FileOutputStream("d:\\2.png");
		//一次读写一个字节数组
		int len;
		byte[] bys = new byte[1024];
		while((len=fis.read(bys)) != -1) {
			fos.write(bys,0,len);
		}
		
		
		fis.close();
		fos.close();
	}
}
